//ICS 314 - Sundial Project
//Yosetime Group
//Spring 2013

import static org.junit.Assert.*;
import org.junit.Test;

/**
 * JUnit Test for Gnomon
 * 
 * @author Kyle Berney
 *
 */
public class GnomonTest {
	private Gnomon gnomon;
	private double latitude = 0.;
	
	@Test
	/**
	 * Checks that the angle of the displayed line is within .6 degrees of the desired angle to be displayed
	 */
	public void testGetPos() {
		gnomon = new Gnomon();
		double error = 0.;
		for (latitude = 0.; latitude <= 90.; latitude += 0.1){
			gnomon.setLatitude(latitude);
			error = gnomon.getPos();
			assertTrue(error <= .6);
		}		
	}
}
